package com.project.class8_24.observer;

public class Test {
    public static void main(String[] args) {
        Product p = new Product();
        Watch1 w1 = new Watch1();
        Watch2 w2 = new Watch2();

        p.addWatch(w1);
        p.addWatch(w2);

        p.setPrice(20);
        System.out.println("代理商1的价格："+w1.getPrice()+"   "+
                "代理商2的价格："+w2.getPrice());

        p.setPrice(30);
        System.out.println("代理商1的价格："+w1.getPrice()+"   "+
                "代理商2的价格："+w2.getPrice());
    }
}
